﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace BackofficeExtremeEvents.Account
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LoginUser.FailureText = "";
            
        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            if (Membership.ValidateUser(LoginUser.UserName, LoginUser.Password))
            {
                FormsAuthentication.SetAuthCookie(LoginUser.UserName, LoginUser.RememberMeSet);
                Response.Redirect("../Home.aspx");
            }
            else
            {
                LoginUser.FailureText = "O Login ou a Password estão incorrectos por favor repita";
            }
        }
    }
}
